// Copyright (C) 2010  Joan Puigcerver Perez, <joapuipe@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

#ifndef __MOVIE_HPP__
#define __MOVIE_HPP__

#include <string>

#include <Node.hpp>
#include <BasicTypes.hpp>
#include <Media.hpp>
#include <Genres.hpp>

/**
 * \class Movie
 *
 * Class derived from Node. It represents a single movie in the
 * bipartite graph. The other class of derived node is Person.
 * \see Node
 * \see Person
 */
class Movie: public Node {
private:
  /** Position of the title of the movie in the string pool. */
  const std::string _title;
  /** Year when the movie was released. */
  Year _year;
  /** Destination of the movie. */
  Media _media;
  /** Was the movie suspended? */
  bool _suspended;
  /** Set of genres. */
  Genres _genres;
  
public:
  /**
   * Classic constructor. This sets the object attributes to the 
   * indicated by the constructor arguments, including the Node identifier.
   * @param id Node identifier.
   * @param title Title of the movie.
   * @param year Year of the releasing.
   * @param media Destination of the movie.
   * @param suspended If it is true, this means that the movie was suspended.
   */
  Movie( const uint32_t id, const std::string& title, const Year year, 
	 const Media media, const bool suspended );
  
  /**
   * This method adds a genre to the set of genres.
   * @param genre Genre identifier to add.
   */
  void add_genre( const size_t genre );
  
  /**
   * This method returns the title of the movie.
   */
  const std::string& title(void) const;

  /**
   * This method returns the year of releasing.
   */
  Year year(void) const;
  
  /**
   * This method returns the media of releasing.
   */
  Media media(void) const;
  
  /**
   * This method returns the set of genres.
   */
  Genres genres(void) const;
  
  /**
   * This method checks if the movie was suspended.
   */
  bool suspended(void) const;
};

#endif
